package com.jkc.xh.models;

import java.io.Serializable;

/**
 * Created by zhangbreeze on 15/11/17.
 */
public class AutoModel implements Serializable {
    public String auto_id;
    public String stock_code;
    public String stock_name;
    public int entrust_bs;
    public long create_time;
    public long update_time;
    public String entrust_goup_price;
    public String entrust_godown_price;
    public String entrust_amount;
    public String start_last_price;
    public String remark;
    public int bstatus;
    public String status;

    /**
     * 获取买卖状态
     *
     * @return
     */
    public String getEntrustStatusText() {
        if (entrust_bs == 1) {
            return "买入";
        } else {
            return "卖出";
        }
    }
    /**
     * 是否可以撤销
     *
     * @return true 可以
     */
    public boolean isCanCancel() {
        if (bstatus == 0) {
            return true;
        } else {
            return false;
        }
    }

    /*
        "auto_id" : "自动委托编号",
        "stock_code" : "证券代码",
        "stock_name" : "名称",
        "entrust_bs" : "方向，1=买，2=卖",
        "create_time" : "委托时间",
        "update_time" : "更新时间",
        "entrust_goup_price" : "上涨触发价",
        "entrust_godown_price" : "下跌触发价",
        "entrust_amount" : "委托数量",
        "start_last_price" : "下单时价",
        "remark" : "备注",
        "bstatus" : "是否可撤，0=可撤，1=不可撤。可撤的话显示撤单按钮，否则显示status",
        "status" : "状态文字"
    * */
}
